package br.com.sistema.entity;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="cliente")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="tipo_pessoa", length=1, discriminatorType=DiscriminatorType.STRING)
@DiscriminatorValue("C")
public class Cliente {
	
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE)
	private Integer clienteid;
	@Column(name="cliente_nome", length=50)
	private String nome;
	@OneToOne
	private Endereco endereco;
	@OneToOne
	private Telefone telefone;
	
	public Cliente() {
	}



	public Integer getClienteid() {
		return clienteid;
	}



	public void setClienteid(Integer clienteid) {
		this.clienteid = clienteid;
	}



	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public Endereco getEndereco() {
		return endereco;
	}

	public void setEndereco(Endereco endereco) {
		this.endereco = endereco;
	}

	public Telefone getTelefone() {
		return telefone;
	}

	public void setTelefone(Telefone telefone) {
		this.telefone = telefone;
	}

}
